package JAVASE525;

import java.util.ArrayList;
import java.util.Scanner;

public class iduserTEST {
    public static void main(String[] args) {
        ArrayList<iduser> list=new ArrayList<>();
        iduser user1=new iduser("1234","zhangsan","12345");
        iduser user2=new iduser("1235","lisi","12345");
        iduser user3=new iduser("1236","wangwu","12345");
        list.add(user1);
        list.add(user2);
        list.add(user3);
        //调用方法
        Scanner sc=new Scanner(System.in);
        String id= sc.next();
        System.out.println(check(list,id));
    }
    public static int check(ArrayList<iduser> list,String id){
        int index=-1;
        for (int i = 0; i < list.size(); i++) {
            if (list.get(i).getId().equals(id)) {
                index=i;
                break;
            }
        }
        return index;
    }
}
